<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateElGiftActivityTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('el_gift_activity', function (Blueprint $table) {

            $table->increments('id');

            $table->string('type')->nullable();  //gift_new_user新人礼   gift_birthday生日礼

            $table->string('name');                 //活动名称

            $table->string('title')->nullable();   //前端标题

            $table->tinyInteger('status')->default(0); 	 //状态：1 有效 ，0 失效

            $table->tinyInteger('open_point')->default(0); 	//赠送积分状态：1 是 ，0 否

            $table->integer('point')->default(0);        //赠送积分

            $table->tinyInteger('open_coupon')->default(0); 	//赠送优惠券状态：1 是 ，0 否

            $table->timestamp('starts_at')->nullable();  //开始时间

            $table->timestamp('ends_at')->nullable();  //结束时间
            
            //积分翻倍

            $table->string('point_double')->default(1);        //积分倍数目

            $table->integer('activity_day')->default(1);        //有效天数。  从生日当天往推前

            $table->nullableTimestamps();

            $table->softDeletes();

            $table->engine = 'InnoDB';

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('el_gift_activity');
    }
}
